dojo.provide("lotex.html.Draw");

//dojo.require("lotex.report.AbstractReport");

lotex.html.Draw = {
    point: function(x,y,color) {
        document.write(
            "<img border='0' style='position: absolute; left: "+
            (x)+"; top:     " +
            (y)+";background-color: "+
            color+"' src='px.gif' width=1 height=1>");
    },

    line: function(x1,y1,x2,y2,color) {
        var tmp;
        if(x1>=x2) {
            tmp=x1;
            x1=x2;
            x2=tmp;
            tmp=y1;
            y1=y2;
            y2=tmp;
        }
        for(var i=x1;i<=x2;i++) {
            x = i;
            y = (y2 - y1) / (x2 - x1) * (x - x1) + y1;
            this.point(x,y,color);
        }
    }
}